import request from '@/utils/request'

// 登录
export function login(data) {
  return request({
    url: '/seat/login',
    method: 'post',
    data
  })
}

// 获取预约信息
export function getInfo(token) {
  return request({
    url: '/seat/info',
    method: 'get',
    params: { token }
  })
}

// 登出
export function logout(token) {
  return request({
    url: '/seat/logout',
    method: 'post',
    params: { token }
  })
}

// 注册
export function register(params) {
  return request({
    url: '/seat/register',
    method: 'post',
    params
  })
}

// 修改密码
export function alterPassword(params) {
  return request({
    url: '/seat/alterPassword',
    method: 'post',
    params
  })
}

// 获取预约数量
export function getCount() {
  return request({
    url: '/seat/count',
    method: 'get'
  })
}

// 查询所有预约信息
export function querySeats() {
  return request({
    url: '/seat/querySeats',
    method: 'get'
  })
}

// 分页查询预约信息
export function querySeatsByPage(params) {
  return request({
    url: '/seat/search',
    method: 'get',
    params
  })
}

// 添加预约信息
export function addSeat(data) {
  return request({
    url: '/seat/addSeat',
    method: 'post',
    data
  })
}

// 删除预约信息
export function deleteSeat(data) {
  return request({
    url: '/seat/deleteSeat',
    method: 'delete',
    data
  })
}

//  删除一些预约信息
export function deleteSeats(data) {
  return request({
    url: '/seat/deleteSeats',
    method: 'delete',
    data
  })
}

//  更新预约信息
export function updateSeat(data) {
  return request({
    url: '/seat/updateSeat',
    method: 'put',
    data
  })
}


//  更新预约信息
export function handleStatus(data) {
  return request({
    url: '/seat/handleStatus',
    method: 'put',
    data
  })
}
